from django.conf import settings
from django.conf.urls import url
from django.urls import path, include
from django.views.static import serve
from rest_framework.routers import DefaultRouter


from apps.common.account.views import UserInfoView, AccountViewSet, RoleViewSet, PermissionViewSet, \
    LoginView
from apps.common.school.views import FacultyViewSet
from apps.club_system.club.views.club_type import ClubTypeViewSet
from apps.club_system.club.views.account import AccountAdministerViewSet
from apps.club_system.club.views.club import ClubViewSet

from apps.club_system.club.views.club_application import ClubApplicationViewSet

from apps.club_system.club.views.club_cancel import ClubCancelViewSet
from apps.club_system.club.views.club_quit import ClubQuitViewSet

from apps.club_system.club.views.function import VisualizationViewSet, UploadViewSet

router = DefaultRouter()

# 账号account 相关的url
router.register('account', AccountViewSet, basename='account')
router.register('role', RoleViewSet, basename='role')
router.register('permission', PermissionViewSet, basename='permission')

# 学校school基础数据相关url
router.register('faculty', FacultyViewSet, basename='faculty')

# 账号表相关url
router.register('account_administer', viewset=AccountAdministerViewSet, basename='account_administer')
# 社团入团url
router.register('club_application', viewset=ClubApplicationViewSet, basename='club_application')
# 社团退团url
router.register('club_quit', viewset=ClubQuitViewSet, basename='club_quit')
# 社团注销url
router.register('club_cancel', viewset=ClubCancelViewSet, basename='club_cancel')
# 可视化url
router.register('visualization', viewset=VisualizationViewSet, basename='visualization')
# 富文本图片上传url
router.register('upload', viewset=UploadViewSet, basename='upload')
# 社团分类相关url
router.register('club_type', ClubTypeViewSet, basename='club_type')
# 社团相关url
router.register('club', viewset=ClubViewSet, basename='club')


urlpatterns = [
    path('login', LoginView.as_view()),
    path('user/info', UserInfoView.as_view()),
    path('api/', include(router.urls)),
]
